import axios from '@/libs/api.request'

export const getData = (params) => {
  return axios.request({
    url: 'budget/index',
    method: 'get',
    params: params
  })
}

export const getReport = (params) => {
  return axios.request({
    url: 'budget/report',
    method: 'get',
    params: params
  })
}
export const getReportData = (params) => {
  return axios.request({
    url: 'budget/getReportData',
    method: 'get',
    params: params
  })
}
export const getLastYearData = (params) => {
  return axios.request({
    url: 'budget/getLastYearData',
    method: 'get',
    params: params
  })
}

export const saveReport = (data) => {
  return axios.request({
    url: 'Budget/saveReport',
    method: 'post',
    data
  })
}
export const downloadReport = (data) => {
  return axios.request({
    url: 'Budget/download',
    method: 'post',
    data,
    responseType: 'arraybuffer'
  })
}
export const batchDownload = (data) => {
  return axios.request({
    url: 'Budget/batchDownload',
    method: 'post',
    data,
    responseType: 'arraybuffer'
  })
}
export const updateRow = (data) => {
  return axios.request({
    url: 'Budget/edit',
    method: 'post',
    data
  })
}

export const pieChart = () => {
  return axios.request({
    url: 'faker/pie',
    method: 'get'
  })
}

export const testApi = () => {
  return axios.request({
    url: 'budget/import',
    method: 'get'
  })
}

export const gen1 = () => {
  return axios.request({
    url: 'faker/gen1',
    method: 'get'
  })
}

export const lists = (params) => {
  return axios.request({
    url: 'faker/lists',
    method: 'get',
    params: params
  })
}

export const download = (params) => {
  return axios.request({
    url: 'faker/download',
    method: 'get',
    params: params,
    responseType: 'blob'
  })
}

export const datas = (params) => {
  return axios.request({
    url: 'faker/data',
    method: 'get',
    params: params
  })
}

export const auditAction = (data) => {
  return axios.request({
    url: 'faker/audit',
    method: 'post',
    data
  })
}

export const cancelAction = (data) => {
  return axios.request({
    url: 'faker/cancel',
    method: 'post',
    data
  })
}

export const pubAction = (params) => {
  return axios.request({
    url: 'faker/pub',
    method: 'get',
    params: params
  })
}
